<?php
/**
 * Created by PhpStorm.
 * User: caoguangyang
 * Date: 2021-05-04
 * Time: 10:53
 */

namespace App\Services;
use App\Constant;
use App\Models\Collect;

class CollectServices extends BaseServices
{
    public function countByGoodsId($userId, $goodsId) {
        return Collect::query()->where("user_id", $userId)
            ->where("value_id", $goodsId)
            ->where("type", 0)
            ->count("id");
    }
}